echo "开始运行！"
cat > $ZOOKEEPER_HOME/conf/zoo.cfg << EOF
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/opt/module/zookeeper/data
dataLogDir=/opt/module/zookeeper/logs
clientPort=2181
server.1=hadoop3:2888:3888
server.2=hadoop4:2888:3888
server.3=hadoop5:2888:3888
# 开启ACL认证（安全必要）
authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider
requireClientAuthScheme=sasl
EOF
sh $ZOOKEEPER_HOME/bin/zkServer.sh start -daemon  # 以守护进程方式运行
echo "运行结束！"